<fieldset><legend>Tambah Barang</legend>
<?
$option=array();
$selected;
$option['kosong']='-Tampilkan Kategori-';
foreach($listKategori as $kategori){
    $option[$kategori->id]=$kategori->nama;
}

$form="
    <table>
        <tr>
            <td width=100>Nama</td><td>".form_input('nama_barang')."</td>
        </tr>
        <tr>
            <td>Kategori</td><td>".form_dropdown('id_kategori', $option)."</td>
        </tr>
        <tr>
            <td>Diskripsi</td><td>".form_textarea(array('name'=>'deskripsi','rows'=>'5','cols'=>'50'))."</td>
        </tr>
        <tr>
            <td>Jumlah Stok</td><td>".form_input('jumlah_stok')."</td>
        </tr>
        <tr>
            <td>Harga Pokok</td><td>".form_input('harga_pokok')."</td>
        </tr>
        <tr>
            <td colspan=2 align=right>".  form_submit(array('value'=>'Simpan'))."</td>
        </tr>
    </table>
";

echo form_open($subLink,'');
echo $form;
echo form_close();
?>
</fieldset>